package com.smmisia.shop.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.Getter;

@Getter
public enum TicketOrderEnum {
    TICKET_ORDER_NOT_PAY(0,"未支付"),
    TICKET_ORDER_PAY(1,"已支付"),
    TICKET_ORDER_CANCEL(2,"已取消");

    @EnumValue
    private Integer code;
    private String desc;

    TicketOrderEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static TicketOrderEnum getEnumByCode(Integer code) {
        for (TicketOrderEnum ticketOrderEnum : TicketOrderEnum.values()) {
            if (ticketOrderEnum.getCode().equals(code)) {
                return ticketOrderEnum;
            }
        }
        return null;
    }
}
